package com.xm.zcf.service.user;

import com.xm.zcf.dao.user.UserDao;
import com.xm.zcf.domain.adminuser.Adminuser;
import com.xm.zcf.domain.user.User;
import com.xm.zcf.util.UUIDutils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2017/3/29.
 */
@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Resource
    private UserDao userDao;

    @Override
    public void save(Adminuser model) {
        String code= UUIDutils.uuid();
        model.setCode(code);
        model.setState(0);
        userDao.save(model);
    }

    @Override
    public Adminuser findByUser(String username, String password) {
        return userDao.findByUser(username,password);
    }
}
